/*
 * MainWindow.h
 *
 *  Created on: 2012-8-28
 *      Author: yangentao@gmail.com
 */

#ifndef MAINWINDOW_H_
#define MAINWINDOW_H_
#include "../winui/ui.h"
#include "../util/util.h"
#include "../win32/win32.h"

using namespace ui;

class MainWindow {

public:
	MainWindow();
	virtual ~MainWindow();
public:
	HWND create(int x, int y, int width, int height);
	void close();
	HMENU createMainMenu();

public:
	void createEdit();
	void OnFinished(HWND w);
	void onCreating(HWND w, CREATESTRUCT* createStruct) ;
	void onMenuItem(UINT menuID);
	void onCreateChildren() ;
	void onLayoutChildren() ;

	void onKeyDown(bool altDown, bool ctrlDown, bool shiftDown, DWORD vKey,
			DWORD lParam, BOOL isRepeat, BOOL& handled);
private:
	MainFrame frame;
	WndUtil edit;
	WindowListenerAdapter adapter;
};

#endif /* MAINWINDOW_H_ */
